<?php
namespace Tbf\Util;
/**
 * @deprecated
 */
class url
{
    /**
     * 保证url最后有一个url目录分割符/
      @param string $path
     */
    public static function addUrlDS($path)
    {
        if (substr($path,-1)!=='/') {
            $path .='/';
        }

        return $path;
    }
    /**
     * 将多个路径使用/链接起来
      @param string $path1
      @param string $path2
     */
    public static function join($path1,$path2=null)
    {
        $path = implode('/',func_get_args());
        $path = self::regularUrl($path);

        return $path;
    }
    /**

    */
    public static function regularUrl($path)
    {
        $path = str_replace('://',':\/\/', $path);
        $path = str_replace('//','/',$path);
        $path = str_replace(':\/\/','://' ,$path);

        return $path;
    }
}
